{{include_file name='public/header' title='数据库配置——安装步骤二'}}
<link href="{{STATIC_URL}}/css/install.css" rel="stylesheet">

</head>

<body>

    <div class="container">
        <div class="row">
            <div class="col-md-10 col-md-offset-1">
                <div class="install-panel panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title text-center">安装步骤二</h3>
                    </div>
                    <div class="panel-body">

                        {{include_file name='public/nav' step=2}}

                        <div class="row">
                            <div class="col-lg-12">
                                <div class="panel panel-default">
                                    <div class="panel-heading">数据库信息</div>

                                    <div class="panel-body">
                                        <form class="form-horizontal" id="js_step2Form" role="form" action="{{url('install/step2')}}" method="post">

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库类型</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[host]" class="form-control disabled" disabled value="MySQL">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库服务器</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[host]" class="form-control" placeholder="数据库服务器地址，一般为localhost" datatype="*">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库端口号</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[port]" class="form-control" datatype="n" value="3306">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库用户名</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[user]" class="form-control" datatype="*">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库密码</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[password]" class="form-control" datatype="*">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库名</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[name]" class="form-control" datatype="*">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">数据库表前缀</label>
                                                <div class="col-sm-10">
                                                    <input type="text" name="step2[prefix]" class="form-control" datatype="*" placeholder="同一个数据库安装多个程序请修改" value="doc_">
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <div class="panel-button text-center">
                                                    <a href="{{url('install/step1')}}" class="btn btn-info">上一步</a>
                                                    <button type="button" class="btn btn-info js_submit">下一步</button>
                                                </div>
                                            </div>
                                        </form>


                                    </div>



                                </div>
                            </div>

                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
    <script>

        $(function(){
            //验证登录表单
            $("#js_step2Form").Validform({

                tiptype:function(msg,o,cssctl){

                    if(!o.obj.is("form")){

                        var objtip=o.obj.siblings(".Validform_checktip");

                        cssctl(objtip,o.type);

                        objtip.text(msg);

                    }

                },

                label:"label",

                ajaxPost:true,

                btnSubmit: '.js_submit',

                callback:function(json){

                    if(json.code == 200){

                        window.location.href = "{{url('install/step3')}}";

                    }else{

                        alert(json.msg, 2000);

                    }

                }

            });


        })

    </script>
    {{include_file name='public/footer'}}
